<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>	
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>修改图书类型</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">

<link rel="stylesheet" href="css/layui.css" media="all">
</head>
<body class="layui-layout-body">

		<div class="layui-layout layui-layout-admin">
		<div class="layui-header">
			<div class="layui-logo">爱阅电子书城</div>
			<!-- 头部区域（可配合layui已有的水平导航） -->
			<ul class="layui-nav layui-layout-right">
				<li class="layui-nav-item"><a href="javascript:;"> <img
						src="http://t.cn/RCzsdCq" class="layui-nav-img"> <%=session.getAttribute("adminName")%>
				</a>
					<dl class="layui-nav-child">
						<dd>
							<a href="javascript:adminInfofun('${user.userName}')">基本资料</a>
						</dd>
						<dd>
							<a href="">安全设置</a>
						</dd>
					</dl></li>
				<li class="layui-nav-item"><a href="">退了</a></li>
			</ul>
		</div>

			<div class="layui-side layui-bg-black">
			<div class="layui-side-scroll">
				<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
				<ul class="layui-nav layui-layout-right" lay-filter="test">
					<li class="layui-nav-item "><a class="" >图书管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="addBookInfo.jsp">添加图书</a>
							</dd>
							<dd>
								<a href="bookInfo.jsp">图书信息</a>
							</dd>

						</dl></li>

					<li class="layui-nav-item"><a class="" >图书类型管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="addBookTypeInfo.jsp">添加图书类型</a>
							</dd>
							<dd>
								<a href="bookTypeInfo.jsp">图书类型信息</a>
							</dd>

						</dl></li>

					<li class="layui-nav-item"><a class="" >用户管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="addUsers.jsp">添加用户</a>
							</dd>
							<dd>
								<a href="userInfo.jsp">用户信息</a>
							</dd>

						</dl></li>
					<li class="layui-nav-item"><a class="" >订单管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="adminOrders.jsp">订单查询</a>
							</dd>

						</dl></li>
				</ul>
			</div>
		</div>

		
		<div class="layui-body">
			<!-- 内容主体区域 -->
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
				<legend>修改图书类型信息</legend>
			</fieldset>
			<form class="layui-form" action="BookTypeServlet?op=update&typeId=${bookType.typeId}" onsubmit="return check()" method="post">
				<div class="layui-form-item">
					<label class="layui-form-label">图书类型名</label>
					<div class="layui-input-block">
						<input type="text" name="typename" id="typename" autocomplete="off" class="layui-input" value="${bookType.typeName}">
						<div id="ts" class="col-sm-10"></div>

					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">类型说明</label>
					<div class="layui-input-block">
						<textarea class="layui-textarea" required="required" name="typedescribe" id="typeInfo"></textarea>
					</div>
				</div>
				<input type="hidden" name="op" value="update">
				<%
					//重复提交 I. 在session范围内产生一个token的值。
					session.setAttribute("token", System.nanoTime() + "");
				%>
				<!-- 重复提交 II 将token通过隐藏域传递给servlet -->
				<input type="hidden" name="token" value="${sessionScope.token}">


				<div class="layui-form-item">
					<div class="layui-input-block">
						<button type="submit" class="layui-btn" href="javascript:updatetypefun('${bookType.typeId}')">修改</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>

		</div>

		<div class="layui-footer">
			<!-- 底部固定区域 -->
			© layui.com - 底部固定区域
		</div>
	</div>
	<script src="http://localhost:8080${pageContext.request.contextPath }/js/jquery-2.2.3.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="layui/layui.all.js" charset="utf-8"></script>
	<script src="js/layui.all.js" charset="utf-8"></script>
	
	<script> 
	<!--给 textarea赋值-->
	document.getElementById("typeInfo").value="${bookType.typeDescribe}";
	<!--修改-->
	function updatetypefun(typeId){
		location.href = "http://localhost:8080/love_reading_ebook_city/BookTypeServlet?op=update&typeId= "
			+ typeId;
	}
	</script>
	<script>
               <!--跳转到个人信息-->
		function adminInfofun(adminName){
			location.href = "http://localhost:8080/love_reading_ebook_city/AdminServlet?op=admininfo&adminName="
				+ adminName;
		} 
		</script>
</body>
</html>
